HTML Pro

an HTML editor for the Macintosh

by Niklas Frykholm



Table of Contents

  1. Introduction
  2. About the Hyper Text Markup Language
  3. Editing text
  4. Styling text
  5. Making lists
  6. Making links
  7. Using the Edit-menu
  8. Opening, Saving & Printing documents
  9. Using Macros
  10. Supported tags
  11. Supported key codes
  12. Known problems with the program
  13. Revision history

1. Introduction

HTML Pro is a program that allows you to edit Hyper Text Markup Language documents (the documents used on the World Wide Web) on your Macintosh.

HTML Pro will display your documents almost as they will look when seen with a web browser, such as Netscape or Mosaic. Some differences exists, partly because I didn't want to create an entire word processing program (I'm a ShareWare writer, not the Microsoft corporation), partly so that the program will run faster and more smoothly.

The differences are explained more thoroughly in the following sections.

HTML Pro is part of the Niklas Frykholm Shareware package - a great concept. By paying a registration fee of $5 you will become a registered owner of the entire package. This includes every program I've ever written together with every program I might ever write in the future. If you have an e-mail address I will mail you new versions and programs when they are done.

Send the money together with your name and address to:

Niklas Frykholm
Rothoffsv. 37 A
903 42 Umeå
Sweden

If you have any comments about this program, you can e-mail me at:

nisfrm95@student.umu.se

Information about this program (current version, etc) and the other programs in the Niklas Frykholm ShareWare Package can be found at my home page:

http://www.ts.umu.se/~r2d2

2. About the Hypertext Markup Language

A key issue when distributing documents and information is compability. Everybody is not able to make use of Microsoft Word documents, PostScript-files or whatever. The Hyper Text Markup Language was created to overcome these difficulties and provide a common platform for hypertext documents.

The HTML files are ordinary text files together with tags that tell the computer how to format the text. Tags are generally written <Start tag>Affected text</End tag> or sometimes just <Single tag>. So to make a word bold you would mark it like <B>this</B> and it would appear like this.

To create special characters in the text such as å ä ö, escape sequences are used. An escape sequence starts with a & and ends with a ;. To create an å in your text you would write &aring;

Entering strange key combinations like those above is not very Macintoshish (or whatever) and that's why you need HTML Pro! HTML Pro let's you work with HTML documents as if you were doing ordinary word processing. Instead of entering &aring; you simply type an å on your keyboard. Instead of writing <B> </B> you select bold from the menu or press command-B on your keyboard.

3. Editing text

To edit text with HTML Pro you do as you are used to from your ordinary word processor. Type on the keyboard, select text with the mouse, use the arrow keys, and so onŠ

HTML Pro uses two editing windows. One window, titled "Source", shows the source text, and the other one, titled "HTML", shows the formatted text. While you'll probably use the HTML window most of the time, you may want to switch to the Source window temporarily to do some "bit flickering" or just to "see how it is done".

The document can be edited in both windows and all menu options - such as copying, pasting, formatting text, etc, etc apply in both windows. To switch between the two windows you can use the View menu or simply click on the window you want to switch to.

4. Styling text

There are two ways of formatting text. You can either use the Styles menu or enter the raw tag codes (<B>, <I>, et cetera) in the source window. The simplest way is of course to use the Styles menu.

To create styled text, just select some text in your document and choose an option from the Styles menu. You can also choose an option directly from the Styles menu. Then when you start to type that style will automatically be used. If you've styled text to the very end of the document it can sometimes be hard to get past the styled text. To do this, switch to the source window, position the cursor at the very end of the text - after all tags, still in the source window type a character and then switch back to the HTML window.

The different styles that can be used in a document are described below.

Headers

HTML Pro supports 6 different levels of headers. Header 1 is the most prominent and typically used at the top of a document. HTML Pro displays the headers as boldface times of various sizes.

Logical

While physical styles tell the computer exactly how to display a piece of text (boldface, italic, etcÉ) logical styles give information of what kind of text it is and let the browser decide exactly how to display it. In general - logical styles are preferrable to physical styles.

Emphasis
Displays the text with emphasis. This is usually done with italics.

Strong
Displays the text with strong emphasis. This is usually done in boldface.

Code
Marks the text as code. This generally means using some fixed-width style, such as Courier or Monaco.

Address

Marks the the text as an address. Addresses are usually displayed in italics.

Keyboard
Marks the text as something that should be entered on the keyboard. Keyboard text is usually displayed in a fixed-width font.

Variable
Marks the text as a variable. Variables are usually displayed in italics.

Definition
Marks the text as a definition.

Citation
Marks the text as a citation. Citations are usually displayed in italics.

Preformatted
Marks the text as having been preformatted in some way. Usually displayed in a fixed width font. Note that the way HTML Pro handles preformatted text differs from the way most web browser handles it. Return characters in the source text are generally not significant, but in preformatted text they should be. HTML Pro, however, does not recognise return characters even in preformatted text, you'll have to use <P> and <BR> tags instead (The reason for this is purely technical). The same applies to the Plain Text tag. There are some ways to work around this problem, for example you can avoid using the preformatted tag, or you can use the preformatted tag and use <P> and <BR> for line feeds (this won't work with the Plain Text tag), or you can use the source window for editing preformatted text and ignore the fact that the HTML window is getting mucked up.

Listing
Marks the text as a computer listing. Note that browsers will not recognise embedded tags inside something that is marked as a listing. HTML Pro, however, will do it.
Plain Text
(Preformatted shown instead)
Marks that the rest of the document should be considered plain text. No embedded tags will be recognised (with browsers, HTML Pro will still recognise them). This tag is of little use and just included for the sake of semi-completeness.
Blockquote
Marks a section of the text as quoted from some other source. Blockquotes are generally displayed slightly indented (although they will not show up this way with HTML Pro).

Sample
Marks a section of the text as sample output

Physical Styles

The Typewriter option displays the text in a fixed-width font (courier). The other options are, should I think, familiar.

Lists & Links

These will be explained in section 5 and section 6 respectively.

Special

The things that didn't fit elsewhere.

Paragraph break

Inserts a paragraph break in the HTML window. Note that line break and paragrah break tags are inserted automatically when you press the return key in the HTML window, so there is little use for this tag.

Line break

Inserts a line break in the HTML window.

Horizontal line


Creates a horizontal line in the HTML window. On most browsers the line will show up as a solid line, often beautifully shadowed. Within the HTML Pro editor, however, the line will show up as a sequence of dashes.

Title (Not shown)

This marks the selected text as being the title of the document. With web browsers, the title of the document is often displayed in the title bar of the document's window. In HTML Pro the surrounding text [TITLE: ] indicates that some text should be considered a title.

If you apply a style to the same selection twice, the effect is to remove the style. Note that for this to happen you must apply the style to exactly the same selection. It is in other words not possible to "unbold" just a part of a bold sentence. It's all or nothing. If you want to partially remove a style using Remove All Tags described in the section on the Edit menu and then reapplying the style is probably the best choice of action.

Also note that nesting tags, in a manner like this: <B>some <I> nested </B> tags </I> is not recommended. It works most of the time, but you may eventually run into problems either with HTML Pro or with a web browser.

5. Making lists

To make a list you enter the items of the list with your keyboard, use the mouse to select the entire list-to-be and choose one of the list options from the Lists submenu in the Styles menu.

An unordered list displays the items without order, usually preceeded by a ·.

An ordered list displays the items in order assigning an ordinal number to each item, starting with 1.

A definition list consists of terms followed by definitions or explanations. The terms are usually displayed in boldface and the explanations slightly indented.

A menu list is the preferred choice when the list is to act as an interactive menu.

A directory list is the preferred choice when the list represents files on some media.

When creating the list the computer will look for line break and paragraph break tags and convert them to list tags, so the different items in the list should be separated by line breaks. Like this:

Sweden
Norway
Finland

Now the text above could be selected and made into a list by using one of the list options above. We can make it into an unordered list:

Or an ordered one:

  1. Sweden
  2. Norway
  3. Finland
When you create a definition list the computer will assume that the first item is a "defintion term" the second "defintion data", the third a term, the fourth data and so onŠ So if you have written something like this:

Luke Skywalker
Luke Skywalker is the last of the Jedi Knights.

Bill Clinton
Bill Clinton is the president of the United States.

It will appear as:

Luke Skywalker
Luke Skywalker is the last of the Jedi Knights.
Bill Clinton
Bill Clinton is the president of the United States.

6. Making Links

Links are the most important feature of hypertext documents. (In fact, that's what the "hyper" in hypertext is all about.) A link is a connection between two documents, so that when you click at a certain word in one you will be taken to the other.

The Other Document option implements this feature. Select the text you want to make into a link and choose Other Document from the Links submenu. A dialog will pop up that allows you to enter the URL of the document that the link points to.

An URL (uniform resource locator) is a way of telling a browser exactly where to find a specific file. If the file is in the same directory as the file with the link, the URL is simply the name of the file. If the file is located in a subdirectory, unix naming conventions are used, so "mail/letters.txt" would indicate the "letters.txt" file located in the "mail" directory situated in the current directory. Note that to move to the parent directory two dots are used so "../index.html" would specify the file "index.html" in the parent directory of the current directory.

If the file is located on another server using relative path names (like the ones above) is not recommendable. Instead you have to specify the name of the server and in what directories/subdirectories the file is located. An absolute path name often starts with the protocol that is used. For hyper text documents the protocol is http (hyper text transfer protocol). So the URL for my home page is:

http://www.ts.umu.se/~r2d2/index.html

Note the structure:

protocol://web_server/directory/filename

It is also possible to create tags that will bring you to a specific part of a document. To do that, first create the anchor that you want the link to point to. Select some text and choose Tag from the Links submenu. Enter whatever you like in the dialog box that pops up. The only thing that's important is that no two anchors have the same identification string.

To create a link to the anchor choose the This Document option from the Links submenu and enter the identification string of the tag you want to link to.

You can also link to a specific part of another document. In that case use the syntax:

URL#tag_name

in the Ohter Document dialog box.

The Image link will include an inline image (in Compuserve GIF format) in your document. Enter the URL of the image you want to include. HTML Pro cannot display the images, it will just show the text [IMAGE] to indicate that there should be an image at that position. You can enter an alternate text when you create an image. If you do, that text will appear on browsers that are unable to show images.

The Mail To link will include a mailto tag in your document. With some browsers - if you click on a mailto tag you will be able to send mail to the linked e-mail address.

IMPORTANT!
HTML Pro handles relative URL specifications very nicely. If you hold down the command key while clicking on a link in a document, the computer will convert the unix file specification to a Macintosh file specification and try to find the document on your hard disk. If it does it will open the document for you and allow you to edit it.

7. Using the Edit Menu

HTML Pro does not support the Undo command. This is entirely due to laziness on my account. Future versions might correct this problem.

Cutting, copying and pasting with HTML Pro works as you're used to. You can cut text from HTML Pro and paste it into some other word processing program or vice versa. Note that when you paste text from some other source into HTML Pro the styles will be removed. It would be nice if the program could convert the styles in the text to the corresponding HTML tags, but unfortunately it can't.

The option Remove All Tags will remove all tags in the selection (save for the <P> and <BR> tags, otherwise the document would get in a terrible mess). You will find Remove All Tags useful if a part of your document has been cluttered with different styles. It is especially useful with lists. If you want to add an item to a list one of the best ways is to select the entire list, choose Remove All Tags, add the item and then reapply the list style. (Another way is to go into the source text and do some bit-flickering.)

The option Update HTML will recreate the styled text in the HTML window based on the current source code. Since the program continuosly updates the HTML view you should never have to use this option. It might be however, that there is some unforeseen bug in the program that clutters up the HTML view. In that case this option can be a last resort.

Selecting Find will bring up a Find/Replace dialog that will seem familiar to you from many other applications. This Find/Replace version is somewhat crippled. The dialog box is not moveable and there are no Whole Words or Match Case features. If I feel like it, I might improve it in the future.

8. Opening, Saving & Printing Documents

If you open a text file with HTML Pro, it will automatically be converted to an HTML file. Line breaks will be replaced by <BR> tags, characters like å will be replaced by there escape sequences &aring; and so on.

Thus the program must be able to differ between ordinary text files and HTML files (which are also a kind of text files). Below I will explain how this is done.

To start with, the program checks the file name. If it ends in .txt the file is assumed to be a text file, if it ends in .html the file is assumed to be an HTML file. If the file name test isn't decisive the program examines the file. It looks for character combinations such as </ which are commonplace in HTML files but extremely rare in ordinary text files. It also looks for special characters, such as å, ä and ö, which can exist in text files but never in HTML-files. If this test isn't enough to determine the type of the file a dialog box will be presented where the user is allowed to specify the file type.

The current version of HTML Pro can only work with one file at a time, so if you open a new file you automatically close the previous one. This might change in future versions.

If the Source window is frontmost when you choose PrintŠ the source text will be printed. If the HTML window is frontmost, the styled text will be printed. PrintŠ will automatically set the margins of the text. If you wish for greater control over how the printed text
will appear I suggest you paste the entire text into some other word processing program.

9. Using Macros

(NOTE! You will only be able to save your Macros if you're running System 7.0 or later.)

While HTML Pro supports the most useful tags there are plenty of tags that the program is not aware of. How do you go about then if you want to use such tags in your HTML Pro document. Do you have to switch to the Source window and enter the tags manually? Luckily not.

HTML Pro allows you to define Macros for these purposes. When you choose Add MacroŠ from the Macros menu a dialog box will appear that allows you to specify the name of the macro, the start tag and the end tag. Let's say you want to create a macro to implement the center tag, which centers a part of the text. Then you might enter something like this:

Macro name: Center
Start tag: <CENTER>
End tag: </CENTER>

Now the name Center will be appended to the Macros menu. If you select some text and choose Center from the Macros menu the text will be surrounded by <CENTER> </CENTER> tags causing it to display centered with some browsers.

To remove a macro use the Remove Macro submenu and select the macro you want to remove.

Your macros will be saved automatically to a file called "HTML Pro Macros" in the Preferences folder in your System folder. If the program for some reason is unable to write to this file you will receive an error message.

Naturally you can create macros for other things than tags. You might want to create a macro for your e-mail address so that it's simple to include it in your document. I myself has found this particular macro useful:

Name: Mail me
Start tag: <A HREF="mailto:nisfrm95@student.umu.se">
End tag: </A>

which links some text to my mailbox without bringing up the Mail To dialog box. Note that macros are inserted in the Source text, therefore if you use special characters, like å, ä and ö in a Macro you should always use the ISO character codes, &aring; and so on. Otherwise you are asking for trouble.

Note that there's a limit on 50 macros.

10. Supported tags

HTML Pro treats the following tags exactly as your HTML browser would:

<H1> <H2> <H3> <H4> <H5> <H6>
<EM> <STRONG> <CODE> <ADDRESS> <KBD> <VAR> <DFN> <CITE> <SAMP>
<B> <U> <I> <TT>
<UL> <OL> <DL> <MENU> <DIR> <LI> <DT> <DD>
<A HREF="..." > <A NAME= "...">
<P> <BR>

The following tags are not displayed exactly as a browser would display them, but some formatting is done to give an idea of what they will look like:

<PRE> <LISTING> <PLAINTEXT> <BLOCKQUOTE>
<IMG SRC="...">
<HR> <TITLE>

Tags not mentioned above are completely ignored by HTML Pro. You may still use them, but no formatting will be done.To be specific, no tags referring to Forms will be recognised by HTML Pro.

11. Supported key codes

There are two ways of specifying a special character; by a keyword and by its ascii equivalent. In the source text it will look like this &keyword; or &#ascii;. Of these two options the former is preferreble, partly because some ascii characters change from font to font, partly because if the browser can't display the character it is easier to understand which character is meant. Not all Macintosh characters are available as keywords, on the other hand, not all keywords are available as Macintosh characters.

Macintosh characters that don't need keywords

! # $ % ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : = ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~

Macintosh characters with keywords

" & < > Ä Å Ç É Ñ Ö Ü á à â ä ã å ç é è ê ë í ì î ï ñ ó ò ô ö õ ú ù û ü ° ¢ £ § · ß ® © ´ ¨ Æ Ø ± ¥ µ æ ø ¡ ¬ À Ã Õ « » ÿ Ù ¤ Â Ê Á Ë È Í Î Ï Ì Ó Ô Ò Ú Ú Û Ù ¸ (non-breaking space, option + space)

Macintosh characters without keywords (using ascii)

(NOTE: Some characters in the list below are also included in the list above. These characters have keywords, but these keywords are not supported by all browsers, so it might be wiser to use ascii codes. Ascii codes will be used if you type these characters on your keyboard.)

; Ý ° ¢ § € ¶ ®  ´ ¨ ‚ ƒ ± ¾ „ ¥ µ  … ½ ¼ † ª º ‡ ¿ ¡ ¬ ˆ Ÿ ‰  « » Š ‘ ¦ ­ ‹ ³ ² Œ ¹ ÷ × Ž ¤ Ð ð Þ þ ý · ’ “ ” • ž – — ¯ ˜ ™ š ¸ › œ 

Keywords without macintosh characters

&ETH; Icelandic capital eth, displayed as: Ð
&eth; Icelandic lower case eth, displayed as: ð
&THORN; Icelandic capital thorn, displayed as: Þ
&yacute; Lower case y with acute accent, displayed as: ý
&Yacute; Upper case y with acute accent, displayed as: Ý
&brvbar; A broken vertical bar, displayed as: ¦
&brkbar; A broken vertical bar, displayed as: &brkbar;
&ordf; Female ordinal character, displayed as: ª
&ordm; Male ordinal character, displayed as: º
&hibar; A high bar, displayed as: &hibar;
&sup1; A superior 1, displayed as: ¹
&sup2; A superior 2, displayed as: ²
&sup3; A superior 3, displayed as: ³
&frac14; Fraction 1/4, displayed as: ¼
&frac12; Fraction 1/2, displayed as: ½
&frac34; Fraction 3/4, displayed as: ¾
&times; Times sign, displayed as: ×
&shy; A soft hyphen, displayed as an ordinary hyphen. ­

12. Known problems with the program

Listed here are some problems with the program that I haven't been able to correct and features that are not yet available.
If you have discovered a bug that is not mentioned above, or if you have some other comments on the program, please mail them to me.

13. Revision History

1.06



Information about this program is available at my home page: http://www.ts.umu.se/~r2d2
You can reach me by e-mail at: nisfrm95@student.umu.se

Niklas Frykholm, 950228